#ifndef CAMERAPARAMETERSWIDGET_H
#define CAMERAPARAMETERSWIDGET_H

#include <QWidget>

namespace Ui {
class CameraParametersWidget;
}

class VisiyunDevice;

class CameraParametersWidget : public QWidget
{
    Q_OBJECT

public:
    explicit CameraParametersWidget(VisiyunDevice *device, QWidget *parent = nullptr);
    ~CameraParametersWidget();

    // 相机参数设置接口
    void setExposureTime(int value);
    void setSamplingFrequency(int value);
    void setGain(int value);

    // 相机参数获取接口
    int getExposureTime() const;
    int getSamplingFrequency() const;
    int getGain() const;

    // 设置参数范围
    void setExposureRange(int min, int max);
    void setFrequencyRange(int min, int max);
    void setGainRange(int min, int max);
    
    // 设置设备指针
    void setDevice(VisiyunDevice *device);

private slots:
    // 内部槽函数处理UI变化
    void on_exposureSlider_valueChanged(int value);
    void on_frequencySlider_valueChanged(int value);
    void on_gainSlider_valueChanged(int value);
    void on_exposureSpinBox_valueChanged(int value);
    void on_frequencySpinBox_valueChanged(int value);
    void on_gainSpinBox_valueChanged(int value);

private:
    Ui::CameraParametersWidget *ui;
    VisiyunDevice *m_device; // 相机设备指针
};

#endif // CAMERAPARAMETERSWIDGET_H